<!DOCTYPE html>
<html lang="zh-cn" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
<title>图灵谷-站点管理-采集管理</title>
<div th:replace="fragments/head_admin">head</div>
</head>
<body class="pace-done fixed-sidebar">
	<div id="wrapper">
		<div th:replace="fragments/menu_admin::menu(root=site,current=collect)">菜单栏</div>
		<div id="page-wrapper" class="gray-bg">
			<div th:replace="fragments/nav_admin">导航栏</div>
			<div th:replace="fragments/breadcrumbs_admin::breadcrumbs(parent=站点管理,current=采集管理)">面包屑栏</div>
			<div class="wrapper wrapper-content animated fadeInRight">
				<div class="row">
					<div class="col-lg-12">
						<div class="ibox float-e-margins">
							<div class="ibox-title">
								<h5>采集管理</h5>
							</div>
							<div class="ibox-content">
								<div class="row m-b-sm m-t-sm">
									<form th:action="@{/admin/m/base/collect/list.gsp}" id="dataTableFilterForm" role="form" action="#" method="post">
										<div class="col-md-8">
											<a th:href="@{/admin/m/base/collect/add.gsp}" data-target="#commonWin" class="btn btn-primary btn-sm" type="button" data-toggle="modal"><i class="fa fa-plus"></i>&nbsp;新增</a>
										</div>
										<div class="col-md-4">
											<div class="input-group">
												<input type="text" hidden="true" /> <input name="simpleQueryParam" type="text" placeholder="请输入关键字搜索" class=" form-control" /> <span class="input-group-btn">
													<button onclick="myTable.filter()" type="button" class="btn btn-sm btn-primary">搜索</button>
												</span>
											</div>
										</div>
									</form>
								</div>
								<table class="table table-striped table-hover">
									<thead>
										<tr>
											<th width="50">#</th>
											<th>状态</th>
											<th>采集名称</th>
											<th>栏目名称</th>
											<th width="120">操作</th>
										</tr>
									</thead>
									<tbody id="dataTableDiv">
									</tbody>
								</table>
								<div id="dataTablePageDiv" class="text-right"></div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div th:replace="fragments/footer_admin">底部</div>
		</div>
	</div>
</body>
<div th:replace="fragments/import_js_admin">引入js</div>
<!--/* 模板引擎生成数据 */-->
<script th:inline="javascript" id="dataTableTpl" type="text/html">
/*<![CDATA[*/
{{# 
var editUrlPre= /*[[@{/admin/m/base/collect/edit_}]]*/'url'; 
var len = d.length;
if(len>0){
	for(var i = 0; i < len; i++){ 
		var record=d[i];
		var num=i+1;
	}}
<tr class="gradeX">
	<td>{{num}}</td>
	<td>
		{{# if(record.enabled===1){ }}
			<input type="checkbox" data-size="mini" data-toggle="toggle" class="js-switch" data-on="启用" data-off="停用" checked="checked" onchange="myTable.changeEnabled(this, '{{record.id}}')" /> 
   	 	{{# }else{ }}
			<input type="checkbox" data-size="mini" data-toggle="toggle" class="js-switch" data-on="启用" data-off="停用" onchange="myTable.changeEnabled(this, '{{record.id}}')" />
		{{# } }}
	</td>
	<td>{{record.collectName}}</td>
	<td class="text-success">{{record.nodeName}}</td>
	<td>
		<a href="{{editUrlPre+record.id}}.gsp" data-target="#commonWin" class="btn btn-primary btn-xs" type="button" data-toggle="modal"><i class="fa fa-edit"></i>&nbsp;修改</a>
		<button class="btn btn-warning btn-xs" type="button" onclick="myTable.deleteItem('{{record.id}}')"><i class="fa fa-trash-o"></i>&nbsp;删除</button>
	</td>
</tr>
	{{# } }}
{{# }else{ }}
    <tr><td colspan="7"><br/><div class="alert alert-danger alert-dismissable">对不起，暂时没有数据可以显示，请更换查询条件重新再试！ <div></td></tr>
{{# } }}
 /*]]>*/
</script>
<script th:inline="javascript">
    /*<![CDATA[*/
    var setting = {
        deleteUrl : /*[[@{/admin/m/base/collect/delete_}]]*/'url',
        enableUrl : /*[[@{/admin/m/base/collect/enable_}]]*/'url',
        disableUrl : /*[[@{/admin/m/base/collect/disable_}]]*/'url',
        enabledChange : true, //修改是否可用
        dataTableTpl : 'dataTableTpl', //模板
        dataTableDiv : 'dataTableDiv', //表格
        dataTableFilterForm : 'dataTableFilterForm' //, //过滤表单
    // dataTablePageDiv : 'dataTablePageDiv', //分页
    // pageable : true, //分页
    // page : 1
    };
    var myTable = new TG_Tabel.createNew(setting);
    $(function() {
        //初始化表格
        myTable.init();
    });
    /*]]>*/
</script>
</html>